package com.geekchique.runningbuddy.view;

import android.view.View;
import android.widget.Button;

import com.geekchique.runningbuddy.controller.MapOfJogsControllerImpl;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;

public class MapOfJogsView {

	@SuppressWarnings("unused")
	private MapActivity mapActivity;
	private MapOfJogsControllerImpl mapOfJogController;
	public MapView mapView;

	public MapOfJogsView(MapActivity mapActivity, MapOfJogsControllerImpl mapOfJogControllerImpl, Button goButton, MapView mapView) {
		this.mapActivity = mapActivity;
		this.mapView = mapView;
		this.mapOfJogController = mapOfJogControllerImpl;

		goButton.setOnClickListener(GoClickListener);
	}

	public void invalidateMapView() {
		this.mapView.invalidate();
	}

	public void toggleSatellite() {
		this.mapView.toggleSatellite();
	}

	public boolean isSatellite() {
		return this.mapView.isSatellite();
	}

	public int getZoomLevel() {
		return this.mapView.getZoomLevel();
	}

	View.OnClickListener GoClickListener = new View.OnClickListener() {

		public void onClick(View arg0) {
			mapOfJogController.plotChosenJog();
			MapOfJogsView.this.mapOfJogController.mapOfJogView.mapView.invalidate();
		}
	};
}
